<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <title>仓储物流</title>
    <link rel="stylesheet" href="../../css/api.css">
    <link rel="stylesheet" href="../../css/vant.css">
    <link rel="stylesheet" href="../../css/main.css">
    <style>

    </style>
</head>

<body>
    <div class="app" v-cloak>
        <div class="header-common f7-header">
            <div class="flex-x-s header ">
                <span class="iconfont goback" @click="back">&#xe66f;</span>
                <div class="title">{{title}}</div>
                <div class="flex-x-s">
                    <div class="header-icon" @click="showDialog(1)">
                        <img src="https://zzzzkj.oss-cn-shanghai.aliyuncs.com/static/tiexie/app/image/image/mine/report.png" alt="">
                    </div>
                    <div class="header-icon" @click="showDialog(2)">
                        <img src="https://zzzzkj.oss-cn-shanghai.aliyuncs.com/static/tiexie/app/image/image/mine/share.png" alt="">
                    </div>
                </div>
            </div>
            <div class="f7-line"></div>
        </div>
        <van-goods-action class="foot">
            <van-goods-action-icon color="#408CEC" icon="service-o" text="客服" @click="sendEvent('goIM')">
            </van-goods-action-icon>
            <van-goods-action-icon :color="isCollect?'#F53B31':'#408CEC'" :icon="isCollect?'star':'star-o'" text="收藏"
                @click="doCollect"></van-goods-action-icon>
            <div class="foot-btn">
                <van-button style="width:2.61rem" class="foot-call" round type="info" @click="sendEvent('call')">立即联系
                </van-button>
            </div>
        </van-goods-action>
    </div>
    <script src="../../script/api.js"></script>
    <script src="../../script/flexible.js"></script>
    <script src="../../script/fastclick.js"></script>
    <script src="../../script/vue.min.js"></script>
    <script src="../../script/iconfont.js"></script>
    <script src="../../script/vant.min.js"></script>
    <script src="../../script/common.js"></script>
    <script src="../../script/restful.js"></script>
    <script src="../../script/businessCommon.js"></script>
    <script>
        apiready = function () {
            vm = new Vue({
                el: '.app',
                data: {
                    module: '',
                    isCollect: false,
                    id: '',
                    title: '',
                },
                mounted() {
                    this.init()
                    this.openFrame()
                },
                methods: {
                    init() {
                        var vm = this
                        vm.title = api.pageParam.title
                        var type = api.pageParam.type
                        var status = api.pageParam.status
                        vm.id = api.pageParam.id
                        if (type == 0) {
                            vm.module = status == 0 ? 'FOR_CAR' : 'FOR_GOODS'
                        } else {
                            vm.module = 'STORAGE'
                        }
                        // 初始化 收藏
                        checkHasCollect(vm.module, vm.id, vm)
                        // 添加浏览
                        addBrowse(vm.module, vm.id)
                    },
                    doCollect() {
                        handleCollect(vm.module, vm.id, vm)
                    },
                    showDialog(type) {
                        if(!checkToken()) return false;
                        toReportOrShareDialog(vm.module, vm.id, type, vm.title)
                    },
                    sendEvent(type) {
                        if (!checkToken()) return false;
                        api.sendEvent({
                            name: 'sendLogistics',
                            extra: {
                                type: type
                            }
                        });
                    },
                    back() {
                        api.closeWin();
                    },
                    openFrame(){
                        api.openFrame({
                            name: 'warehouse_logistics_detail_frm',
                            url: 'warehouse_logistics_detail_frm.html',
                            reload:true,
                            rect: {
                                marginTop: $api.fixStatusBar($api.dom('.header-common')) + 4,
                                marginBottom: $api.fixTabBar($api.dom(".foot")),
                                w: 'auto'
                            },
                            pageParam: api.pageParam
                        });
                    }
                },
            })
        }
    </script>
</body>

</html>